package com.bmcsoft.service.impl;

/**
 * @User: Alan
 * @Date: 2019/9/23
 * @Time: 15:04
 * @Version: 1.0
 */

import com.bmcsoft.dao.AccountDao;
import com.bmcsoft.dao.impl.AccountDaoImpl;
import com.bmcsoft.factory.BeanFactory;
import com.bmcsoft.service.AccountService;

/**
 * 账户业务层的实现类
 */
public class AccountServiceImpl implements AccountService {

//    private AccountDao accountDao = new AccountDaoImpl();
    //控制权发生了转移，称为控制反转（IOC）
    private AccountDao accountDao = (AccountDao)BeanFactory.getBean("accountDao");

    private  int i = 1;
    public void saveAccount(){
        accountDao.saveAccount();
        System.out.println(i);
        i++;
    }
}
